package com.liuhongwei.test.entity.vo;


public class JSONResponse extends JSONCommon {

    //定义返回的CODE
    private int code;
    //定义返回的消息
    private String msg;
    //业务数据
    private Object data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static JSONResponse success(Object data){

        JSONResponse jsonResponse = new JSONResponse();
        jsonResponse.setCode(ResponseCode.OK);
        jsonResponse.setMsg(ResponseCodeEnum.CODE_200.getMsg());
        jsonResponse.setData(data);
        return jsonResponse;
    }





}
